package com.toycloud.common.excel.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class DemandTypeConverter implements Converter<String> {

    @Override
    public Class<String> supportJavaTypeKey() {
        return String.class;
    }

    @Override
    public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        if ("0".equals(value)) {
            return new WriteCellData<>("未定义");
        } else if ("1".equals(value)) {
            return new WriteCellData<>("新增特性");
        } else if ("2".equals(value)) {
            return new WriteCellData<>("体验优化");
        } else if ("3".equals(value)) {
            return new WriteCellData<>("缺陷修复");
        } else {
            return new WriteCellData<>(value);  // 默认保持原值
        }
    }
}

